package com.fatcat.easybuy.service;


import com.fatcat.easybuy.pojo.EasyBuyProductCategory;
import com.fatcat.easybuy.pojo.EasyBuyProductCategoryDTO;
import com.fatcat.easybuy.pojo.EasyBuyProductCategoryNode;

import java.util.List;

/**
* @author Fatcat
* @description 针对表【easybuy_product_category】的数据库操作Service
* @createDate 2025-09-10 11:07:47
*/

public interface EasyBuyProductCategoryService {
    //构建树结构的方法组
    List<EasyBuyProductCategoryDTO> getCategoryTree();

    List<EasyBuyProductCategoryNode> buildTree(List<EasyBuyProductCategory> categories);

    List<EasyBuyProductCategoryDTO> convertToDto(List<EasyBuyProductCategoryNode> nodes);

    EasyBuyProductCategoryDTO convertNode(EasyBuyProductCategoryNode node);

    //增删改
    boolean addCategory(EasyBuyProductCategory easyBuyProductCategory);
    boolean updateCategory(EasyBuyProductCategory easyBuyProductCategory);
    boolean deleteCategory(Long id);

    List<EasyBuyProductCategory> getLevel1Categories();

    List<EasyBuyProductCategory> getCategoriesByParentId(Long parentId);

    boolean updateProductLevel(Long categoryLevel1Id,Long categoryLevel2Id,Long categoryLevel3Id,EasyBuyProductCategory easyBuyProductCategory);
}
